<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        ul{
            list-style: none;
            margin: 0;
            padding: 0;
        }
        li{
            display: inline-block;
            width: 100px;
            height: 50px;
            border: 1px solid;
            line-height: 50px;
            text-align: center;
            cursor: pointer;
        }
        .box div{
            width: 400px;
            height: 400px;
            border: 10px dotted red;
        }
        .red{
            background-color: crimson;
        }
    </style>
</head>
<body>
    <div id="app">
        <h1>刘为的手机APP</h1>
        <ul>
            <li v-for='item,index in newsList' :key="item.id" @click='selectShow(index)' :class="index==currientIndex?liClass:''">{{item.title}}</li>
        </ul>
        <div class="box">
            <div v-for='item,index in newsList' :key="item.id" v-show='index==currientIndex'>{{item.title}}</div>
        </div>
        
    </div>
    <script src="../../js/vue.js"></script>
    <script>
        var vm = new Vue({
            el:'#app',
            data:{
                newsList:[
                    {
                        id:1,
                        title:'欧美视频',
                        content:'欧美视频'
                    },
                     {
                        id: 2,
                        title: '日韩视频',
                        content: '日韩视频'
                    },
                     {
                        id: 3,
                        title: '国内视频',
                        content: '国内视频'
                    },
                ],
                currientIndex:0,
                liClass:{
                    'red':true
                }
            },
            methods: {
                selectShow(index){
                    this.currientIndex = index;

                }
            },
        })
    </script>
</body>
</html>